clear matrix
clear mata 
set maxvar 10000
use public_accommodations_replication_final.dta, replace


log using public_accommodations_replication


*Table 2 

ttest weighttrimmedpre if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest weighttrimmedpre if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest weighttrimmedpre if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest heighttrimmedpre if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest heighttrimmedpre if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest heighttrimmedpre if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest agetrimmedpre if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest agetrimmedpre if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest agetrimmedpre if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest preweightdiffmean if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest preweightdiffmean if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest preweightdiffmean if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest urban7983mean if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest urban7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest urban7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest manufoutput7983mean if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest manufoutput7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest manufoutput7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest propfarm7983mean if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest propfarm7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest propfarm7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest pctblack7983mean if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest pctblack7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest pctblack7983mean if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest weighttrimmedpre if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest weighttrimmedpre if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest weighttrimmedpre if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest heighttrimmedpre if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest heighttrimmedpre if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest heighttrimmedpre if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest agetrimmedpre if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest agetrimmedpre if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest agetrimmedpre if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest preweightdiffmean if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest preweightdiffmean if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest preweightdiffmean if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest manufoutput7983mean if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest manufoutput7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest manufoutput7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest urban7983mean if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest urban7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest urban7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest propfarm7983mean if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest propfarm7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest propfarm7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest pctblack7983mean if usct==0 & ua_rd_sample==1, by(badstatemean7987)
ttest pctblack7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest pctblack7983mean if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

*Figures 2 and 3

preserve

keep if usct_rd_sample_mean==1 
bys recid: egen badstatemean=mean(badstate)
twoway (lpolyci weighttrimmed sixmo if badstatemean==0 & sixmo<0, clpattern(dash) fcolor(%40) alalign(dash)) (lpolyci weighttrimmed sixmo if badstatemean==1  & sixmo<0, fcolor(%40)) (scatter weighttrimmed sixmo if badstatemean==0 & sixmo<0, msymbol(circle_hollow)) (scatter weighttrimmed sixmo if badstatemean==1  & sixmo<0)
graph save figure2.gph, replace
restore

preserve

keep if ua_rd_sample_mean==1 
bys recid: egen badstatemean=mean(badstate)
twoway (lpolyci weighttrimmed sixmo if badstatemean==0 & sixmo<0, clpattern(dash) fcolor(%40) alalign(dash)) (lpolyci weighttrimmed sixmo if badstatemean==1  & sixmo<0, fcolor(%40)) (scatter weighttrimmed sixmo if badstatemean==0 & sixmo<0, msymbol(circle_hollow)) (scatter weighttrimmed sixmo if badstatemean==1  & sixmo<0)
graph save figure3.gph, replace

restore

*Table 3

eststo m1: reg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 , cluster(distancemean_7987_20)
eststo m2: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , cluster(distancemean_7987_20)

eststo m3: reg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & distancemean7987<300 , cluster(distancemean_7987_20)
eststo m4: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & distancemean7987<300, cluster(distancemean_7987_20)

eststo m5: reg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & distancemean7987<200 , cluster(distancemean_7987_20)
eststo m6: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & distancemean7987<200, cluster(distancemean_7987_20)

estout m1 m2 m3 m4 m5 m6 using Table3.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N )

*Table 4

eststo m1: areg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1, vce(cluster distancemean_7987_20) absorb(recid)
eststo m2: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) absorb(recid)

eststo m3: areg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & distancemean7987<300, vce(cluster distancemean_7987_20) absorb(recid)
eststo m4: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & distancemean7987<300 , vce(cluster distancemean_7987_20) absorb(recid)

eststo m5: areg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & distancemean7987<200, vce(cluster distancemean_7987_20) absorb(recid)
eststo m6: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & distancemean7987<200 , vce(cluster distancemean_7987_20) absorb(recid)

estout m1 m2 m3 m4 m5 m6 using Table4.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N ) 

*Table 5

eststo m1: reg weighttrimmed badstate_post i.year i.state_num if ua_rd_sample_mean==1 , cluster(distancemean_7987_20)
eststo m2: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 , cluster(distancemean_7987_20)

eststo m3: reg weighttrimmed badstate_post i.year i.state_num if ua_rd_sample_mean==1 & distancemean7987<300 , cluster(distancemean_7987_20)
eststo m4: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 & distancemean7987<300, cluster(distancemean_7987_20)

eststo m5: reg weighttrimmed badstate_post i.year i.state_num if ua_rd_sample_mean==1 & distancemean7987<200 , cluster(distancemean_7987_20)
eststo m6: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 & distancemean7987<200, cluster(distancemean_7987_20)

estout m1 m2 m3 m4 m5 m6 using Table5.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 6", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N )

*Table 6

eststo m1: areg weighttrimmed badstate_post i.year i.state_num if ua_rd_sample_mean==1, vce(cluster distancemean_7987_20) absorb(recid)
eststo m2: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 , vce(cluster distancemean_7987_20) absorb(recid)

eststo m3: areg weighttrimmed badstate_post i.year i.state_num if ua_rd_sample_mean==1 & distancemean7987<300, vce(cluster distancemean_7987_20) absorb(recid)
eststo m4: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 & distancemean7987<300 , vce(cluster distancemean_7987_20) absorb(recid)

eststo m5: areg weighttrimmed badstate_post i.year i.state_num if ua_rd_sample_mean==1 & distancemean7987<200, vce(cluster distancemean_7987_20) absorb(recid)
eststo m6: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 & distancemean7987<200 , vce(cluster distancemean_7987_20) absorb(recid)

estout m1 m2 m3 m4 m5 m6 using Table6.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N )  

*Table 7

ttest weighttrimmedmeandiffnm if usct==1 & usct_rd_sample==1, by(badstatemean7987) 
ttest weighttrimmedmeandiffnm if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987) 
ttest weighttrimmedmeandiffnm if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987) 


ttest weighttrimmedmeandiffnm if usct==0 & ua_rd_sample==1, by(badstatemean7987) 
ttest weighttrimmedmeandiffnm if usct==0 & ua_rd_sample==1 & distancemean7987<=300, by(badstatemean7987) 
ttest weighttrimmedmeandiffnm if usct==0 & ua_rd_sample==1 & distancemean7987<=200, by(badstatemean7987) 

*Table 8

eststo m1: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==1 & sameborder==1 & heighttrimmedpre~=. & weighttrimmedpre~=. & agetrimmedpre~=. & urban7983mean~=. & propfarm7983mean~=. & manufoutput7983mean~=. & pctblack7983mean~=. & lat_avg~=. & long_avg~=., all vce (cluster distancemean_7987_20) 
eststo m2: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==1 & sameborder==1 , all vce (cluster distancemean_7987_20) covs( agetrimmedpre heighttrimmedpre weighttrimmedpre urban7983mean manufoutput7983mean propfarm7983mean pctblack7983mean segment_2-segment_4) 

eststo m3: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==1 & sameborder==1 & heighttrimmedpre~=. & weighttrimmedpre~=. & agetrimmedpre~=. & urban7983mean~=. & propfarm7983mean~=. & manufoutput7983mean~=. & pctblack7983mean~=. & lat_avg~=. & long_avg~=. & preweightdiffmean~=., all vce (cluster distancemean_7987_20) 
eststo m4: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==1 & sameborder==1 , all vce (cluster distancemean_7987_20) covs( agetrimmedpre heighttrimmedpre weighttrimmedpre urban7983mean manufoutput7983mean propfarm7983mean pctblack7983mean preweightdiffmean segment_2-segment_4) h(80) b(140)

eststo m5: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==0 & sameborder==1 & heighttrimmedpre~=. & weighttrimmedpre~=. & agetrimmedpre~=. & urban7983mean~=. & propfarm7983mean~=. & manufoutput7983mean~=. & pctblack7983mean~=. & lat_avg~=. & long_avg~=., all vce (cluster distancemean_7987_20) 
eststo m6: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==0 & sameborder==1 , all vce (cluster distancemean_7987_20) covs( agetrimmedpre heighttrimmedpre weighttrimmedpre urban7983mean manufoutput7983mean propfarm7983mean pctblack7983mean segment_2-segment_4) 

eststo m7: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==0 & sameborder==1 & heighttrimmedpre~=. & weighttrimmedpre~=. & agetrimmedpre~=. & urban7983mean~=. & propfarm7983mean~=. & manufoutput7983mean~=. & pctblack7983mean~=. & lat_avg~=. & long_avg~=. & preweightdiffmean~=., all vce (cluster distancemean_7987_20) 
eststo m8: rdrobust weighttrimmedmeandiffnm distancemean7987_running if usct==0 & sameborder==1 , all vce (cluster distancemean_7987_20) covs( agetrimmedpre heighttrimmedpre weighttrimmedpre urban7983mean manufoutput7983mean propfarm7983mean pctblack7983mean preweightdiffmean segment_2-segment_4) 

estout m1 m2 m3 m4 m5 m6 m7 m8 using Table8.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7" "Model 8", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)  s( N h_l b_l ) 

*Table 9

eststo m1: rdrobust weighttrimmedmeandiffnm distancemean7987_running if sameside60==1 & usct==1 & sameborder==1 & heighttrimmedpre~=. & weighttrimmedpre~=. & agetrimmedpre~=. & urban7983mean~=. & propfarm7983mean~=. & manufoutput7983mean~=. & pctblack7983mean~=. & lat_avg~=. & long_avg~=., all vce (cluster distancemean_7987_20) 
eststo m2: rdrobust weighttrimmedmeandiffnm distancemean7987_running if sameside60==1 & usct==1 & sameborder==1 , all vce (cluster distancemean_7987_20) covs( agetrimmedpre heighttrimmedpre weighttrimmedpre urban7983mean manufoutput7983mean propfarm7983mean pctblack7983mean segment_2-segment_4) 

eststo m3: rdrobust weighttrimmedmeandiffnm distancemean7987_running if sameside60==1 & usct==0 & sameborder==1 & heighttrimmedpre~=. & weighttrimmedpre~=. & agetrimmedpre~=. & urban7983mean~=. & propfarm7983mean~=. & manufoutput7983mean~=. & pctblack7983mean~=. & lat_avg~=. & long_avg~=., all vce (cluster distancemean_7987_20) 
eststo m4: rdrobust weighttrimmedmeandiffnm distancemean7987_running if sameside60==1 & usct==0 & sameborder==1 , all vce (cluster distancemean_7987_20) covs( agetrimmedpre heighttrimmedpre weighttrimmedpre urban7983mean manufoutput7983mean propfarm7983mean pctblack7983mean segment_2-segment_4) 

estout m1 m2 m3 m4 using Table9.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N h_l b_l) 

*Table 10

eststo m1: areg weighttrimmed badstate_post_1876 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

eststo m2: areg weighttrimmed badstate_post_1877 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

eststo m3: areg weighttrimmed badstate_post_1878 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

eststo m4: areg weighttrimmed badstate_post_1879 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

eststo m5: areg weighttrimmed badstate_post_1880 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

eststo m6: areg weighttrimmed badstate_post_1881 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

eststo m7: areg weighttrimmed badstate_post_1882 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1, cluster(distancemean_7583_20) absorb(recid)

estout m1 m2 m3 m4 m5 m6 m7 using Table10.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N ) 

*Table 11

eststo m1: areg systemic badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , absorb(recid) cluster (distancemean_7987_20) 
eststo m2: areg systemic badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & distancemean7987<=300, absorb(recid) cluster (distancemean_7987_20) 
eststo m3: areg systemic badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & distancemean7987<=200,absorb(recid)  cluster(distancemean_7987_20) 

estout m1 m2 m3 using Table11.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N ) 

use age_married_owns.dta, replace

*Table 12

sum agetrimmed if usct_rd_sample_mean==1

sum married if usct==1 & usct_rd_sample==1

sum ownsvs if usct==1 & usct_rd_sample==1

use public_accommodations_replication_final.dta, replace

*Table 13

ttest weighttrimmedpre if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest heighttrimmedpre if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest agetrimmedpre if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest preweightdiffmean if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest infectpre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest cardiopre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest eyepre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest endocrinepre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest gastropre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest kidneypre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest abnormalresppre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest herniapre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest tumorpre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest musculoskeletalpre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest rectumpre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest mentalpre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)
ttest varicosepre_new if usct==1 &  badstate==1 , by(usct_sample_notsample)


ttest weighttrimmedpre if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest heighttrimmedpre if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest agetrimmedpre if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest preweightdiffmean if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest infectpre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest cardiopre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest eyepre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest endocrinepre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest gastropre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest kidneypre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest abnormalresppre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest herniapre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest tumorpre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest musculoskeletalpre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest rectumpre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest mentalpre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)
ttest varicosepre_new if usct==1 &  badstate==0 , by(usct_sample_notsample)

*Table 14

ttest infectpre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest infectpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest infectpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest cardiopre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest cardiopre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest cardiopre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest eyepre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest eyepre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest eyepre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest endocrinepre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest endocrinepre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest endocrinepre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest gastropre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest gastropre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest gastropre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest kidneypre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest kidneypre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest kidneypre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest abnormalresppre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest abnormalresppre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest abnormalresppre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest herniapre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest herniapre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest herniapre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest tumorpre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest tumorpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest tumorpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest musculoskeletalpre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest musculoskeletalpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest musculoskeletalpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest rectumpre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest rectumpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest rectumpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest mentalpre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest mentalpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest mentalpre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

ttest varicosepre_new if usct==1 & usct_rd_sample==1, by(badstatemean7987)
ttest varicosepre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=300, by(badstatemean7987)
ttest varicosepre_new if usct==1 & usct_rd_sample==1 & distancemean7987<=200, by(badstatemean7987)

*Table 15

eststo m1: reg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & preweightdiffmean~=., cluster(distancemean_7987_20)
eststo m2: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm preweightdiffmean if usct_rd_sample_mean==1 & preweightdiffmean~=., cluster(distancemean_7987_20)

eststo m3: reg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & preweightdiffmean~=. & distancemean7987<300 , cluster(distancemean_7987_20)
eststo m4: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm  preweightdiffmean if usct_rd_sample_mean==1 & preweightdiffmean~=. & distancemean7987<300 , cluster(distancemean_7987_20)

eststo m5: reg weighttrimmed badstate_post i.year i.state_num if usct_rd_sample_mean==1 & preweightdiffmean~=. & distancemean7987<200 , cluster(distancemean_7987_20)
eststo m6: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm preweightdiffmean if usct_rd_sample_mean==1 & preweightdiffmean~=. & distancemean7987<200 , cluster(distancemean_7987_20)

estout m1 m2 m3 m4 m5 m6 using Table15.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N ) 

*Table 16 

eststo m1: areg weighttrimmed badstate_post_1876 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

eststo m2: areg weighttrimmed badstate_post_1877 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

eststo m3: areg weighttrimmed badstate_post_1878 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

eststo m4: areg weighttrimmed badstate_post_1879 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

eststo m5: areg weighttrimmed badstate_post_1880 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

eststo m6: areg weighttrimmed badstate_post_1881 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

eststo m7: areg weighttrimmed badstate_post_1882 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<300, cluster(distancemean_7583_20) absorb(recid)

estout m1 m2 m3 m4 m5 m6 m7 using Table16.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N ) 

*Table 17

eststo m1: areg weighttrimmed badstate_post_1876 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

eststo m2: areg weighttrimmed badstate_post_1877 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

eststo m3: areg weighttrimmed badstate_post_1878 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

eststo m4: areg weighttrimmed badstate_post_1879 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

eststo m5: areg weighttrimmed badstate_post_1880 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

eststo m6: areg weighttrimmed badstate_post_1881 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

eststo m7: areg weighttrimmed badstate_post_1882 i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct==1 & examdate>18751015 & examdate<18831015 & sameborder1879==1 & distancemean7583<200, cluster(distancemean_7583_20) absorb(recid)

estout m1 m2 m3 m4 m5 m6 m7 using Table17.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N )  

*Table 18

eststo m1: reg abnormalresp_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m2: reg hernia_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m3: reg tumor_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m4: reg musculoskeletal_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m5: reg rectum_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m6: reg mental_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m7: reg varicose_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 

estout m1 m2 m3 m4 m5 m6 m7 using Table18_panel1.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6" "Model 7", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N ) 

eststo m2: reg infect_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m3: reg cardio_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m4: reg eye_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m5: reg endocrine_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m6: reg gastro_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 
eststo m7: reg kidney_rat badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 , vce(cluster distancemean_7987_20) 

estout m2 m3 m4 m5 m6 m7 using Table18_panel2.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4" "Model 5" "Model 6", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .10 ** .05 *** .01)   s( N )  

*Table 19

eststo m1: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & postrulinglaw~=1, cluster(distancemean_7987_20)

eststo m2: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if usct_rd_sample_mean==1 & postrulinglaw~=1 , vce(cluster distancemean_7987_20) absorb(recid)

eststo m3: reg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 & postrulinglaw~=1, cluster(distancemean_7987_20)

eststo m4: areg weighttrimmed badstate_post i.year i.state_num agetrimmed heighttrimmed percentblack manufoutput urban proportionfarm if ua_rd_sample_mean==1 & postrulinglaw~=1 , vce(cluster distancemean_7987_20) absorb(recid)

estout m1 m2 m3 m4  using Table19.tex, replace style(tex) collabels(none) mlabels("Model 1" "Model 2" "Model 3" "Model 4", span prefix(\multicolumn{@span}{c}{) suffix(})) prehead("\begin{table}[htbp!]\caption{@title}" "\begin{center}" "\scriptsize" "\begin{threeparttable}"  "\begin{tabular}{l*{@M}{rr}}" "\hline")  cells(  b(star fmt(2)) se(par fmt(2)) ) starlevels(* .105 ** .05 *** .01)   s( N )  


log close



